<script setup lang="ts">
  import { ref } from 'vue';
  import Home from '@/components/Home.vue';

  var sub = ref()
  var name = ref()
  var age = ref()

  const showVal = ()=>{
    console.log(sub.value)
    name.value = sub.value.name
    age.value = sub.value.age
  }
</script>
<template>
  <Home ref="sub"></Home>
  <div>
    name:{{ name }}
    <br>
    age:{{ age }}
  </div>
  <button @click="showVal">showVal</button>
</template>
<style scoped></style>